package com.cdp.web.controller.system;

import com.cdp.common.core.domain.AjaxResult;
import com.cdp.common.core.domain.entity.SysDurabilityPerformance;
import com.cdp.system.dto.DurabilityPerformanceDTO;
import com.cdp.system.service.ISysDurabilityPerformanceService;
import com.cdp.system.vo.DeformationPerformanceVO;
import com.cdp.system.vo.DurabilityPerformanceVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.stream.Collectors;

/**
 * 耐久性能信息
 */
@RestController
@RequestMapping("/system/durability")
public class SysDurabilityPerformanceController {

    @Autowired
    private ISysDurabilityPerformanceService sysDurabilityPerformanceService;


    /**
     * 查询耐久信息集合
     * @return
     */
    @GetMapping("listDurabilityPer")
    private AjaxResult listDurabilityPer() {
        List<SysDurabilityPerformance> performanceList = sysDurabilityPerformanceService.listDurabilityPer();
        return AjaxResult.success(performanceList);
    }


    /**
     * 耐久性能模糊查询
     */
    @PostMapping("queryMistedDeformationPerformance")
    public AjaxResult queryMistedDeformationPerformance(@RequestBody DurabilityPerformanceDTO durabilityPerformanceDTO) {
        // 调用服务层方法获取查询结果
        List<DurabilityPerformanceVO> results = sysDurabilityPerformanceService.queryMistedDeformationPerformance(durabilityPerformanceDTO);


        // 返回查询结果
        return AjaxResult.success(results);
    }





}
